<?php

namespace Miniapp\Controllers;

class AuthController extends BaseController {

    protected $userId;
    protected $user;

    public function initialize() {
        parent::initialize();
        $this->logger->write_log("userId:" . $this->userId, "info");
        if (!empty($_POST['userId'])) {
            $this->userId = lib("Encrypt")->decrypt($_POST['userId']);
            $this->user = service("User/UserService")->getUserInfoByUserId($this->userId);
            if (!$this->user) {
                E('用户不存在');
            }
        }
    }

}
